package com.bky.agent.proxy;

import com.bky.agent.statical.TicketSubject;
import com.bky.agent.statical.impl.TrainStation;

import java.lang.reflect.Proxy;

/**
 * @Author shipeilei
 * @Date Created on 2018/5/13
 */
public class TestProxy {
    public static void main(String[] args) {
        TrainStation trainStation = new TrainStation();
        TrainStationHandler handler = new TrainStationHandler(trainStation);
        TicketSubject subject = (TicketSubject) Proxy.newProxyInstance(TicketSubject.class.getClassLoader(), new Class[]{TicketSubject.class}, handler);
        subject.sell();
    }
}
